<template>
	<view class="content bg-gray">
		<!-- <uni-nav-bar title="个人中心"></uni-nav-bar> -->
		<view class=" padding-xl text-center bg-blue">
			<view class="flex justify-center">
				<u-avatar :src="userinfo.headimg" shape="circle" :size="65"></u-avatar>
			</view>
			<view class="margin-top">{{userinfo.nickname}}</view>
		</view>
		<!-- <u-notice-bar :text="tips" :speed="50" mode="closable"></u-notice-bar> -->
		<view class="padding-xl bg-white radius">
			
			<u-row class="flex align-center">
				<u-col span="4">
					<view class="text-center text-bold text-xxl">{{amount.ktx}}</view>
					<view class="text-center">可提现金额</view>
				</u-col>
				<u-col span="4">
					<view class="text-center text-bold text-xxl">{{amount.djs}}</view>
					<view class="text-center">待结算金额</view>
				</u-col>
				<u-col span="4">
					<view class="text-center text-bold text-xxl">{{amount.ordernum}}</view>
					<view class="text-center">订单数</view>
				</u-col>
			</u-row>
		</view>
		<view class="cu-list menu  margin-top-xl">
			<view class="cu-item arrow" @click="goqrcode()">
				<view class="content">
					<text class="margin-right-xs text-green cuIcon-qrcode"></text>
					<text class="text-grey">我的二维码</text>
				</view>
			</view>
			<view class="cu-item arrow" @click="gotx()">
				<view class="content">
					<text class="margin-right-xs text-red cuIcon-moneybag"></text>
					<text class="text-grey">我要提现</text>
				</view>
			</view>
			<view class="cu-item arrow" @click="goorder()">
				<view class="content">
					<text class="margin-right-xs text-red cuIcon-cartfill"></text>
					<text class="text-grey">订单明细</text>
				</view>
			</view>

		</view>
		<!-- <u-tabbar value="my" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" activeColor="#303133">
			<u-tabbar-item name="mall" text="云店首页" icon="home" @click="click('mall')"></u-tabbar-item>
			<u-tabbar-item name="order" text="订单" icon="grid" @click="click('order')"></u-tabbar-item>
			<u-tabbar-item name="my" text="我的" icon="account-fill"></u-tabbar-item>
		</u-tabbar> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo: {
					nickname: "",
					headimg: ""
				},
				amount:{
					ktx:"0.00",
					djs:"0.00",
					ordernum:"0"
				},
				tips:"每日1时后更新前一日数据",
				isktx:"0",
			}
		},
		onLoad() {
			this.AXIOS.Request(true, 'POST', {
				url: "/api/app/getuinfo?c=" + this.mallcode
			}, (res) => {
				var rst = res.data;
				if (rst.code == 100) {
					this.userinfo = rst.data
				} else {
					uni.showToast({
						title: rst.msg,
						icon: "none"
					})
				}
			})
			this.AXIOS.Request(true, 'POST', {
				url: "/api/app/hlnkvxo6?c=" + this.mallcode
			}, (res) => {
				var rst = res.data;
				if (rst.code == 100) {
					this.amount = rst.data
					this.isktx=rst.isktx
				} else {
					uni.showToast({
						title: rst.msg,
						icon: "none"
					})
				}
			})
		},
		methods: {
			goqrcode() {
				uni.navigateTo({
					url: "/pages/index/qrcode"
				})
			},
			goorder() {
				// uni.showToast({
				// 	title: "即将上线",
				// 	icon: "none"
				// })
				uni.navigateTo({
					url: "/pages/order/order"
				})
			},
			gotx() {
				if(this.isktx=="1"){
					uni.navigateTo({
						url: "/pages/withdraw/withdraw"
					})
				}else{
					uni.showToast({
						title:"暂无可提现金额",
						icon:"none"
					})
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		height: 100%;
	}

	.content {
		height: 100%;
	}
</style>